package com.daqian.chance.example.admin.modules.system.po.dto;

import com.daqian.chance.common.base.BaseDTO;
import com.daqian.chance.example.admin.modules.system.po.entity.SysRole;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * <p>
 * 系统-角色
 * </p>
 *
 * @author daqian
 * @since 2019-08-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SysRoleDTO extends BaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    /**
     * 角色名
     */
    private String roleName;

    /**
     * 描述
     */
    private String description;


    /**
     * 将DTO转换成实体类
     *
     * @return E
     */
    @Override
    public SysRole convertToEntity() {
        SysRole entity = new SysRole();
        BeanUtils.copyProperties(this, entity);
        return entity;
    }
}
